package com.tcsl.exercise.demo.entity;


import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

public class ItemEntity {
    @NotNull(message = "id不能为空")
    @Min(value = 0, message = "输入的Id无效")
    private Long id;

    @NotNull(message = "名称不能为空")
    private String name;

    @NotNull(message = "请选择分类")
    private Long specId;

    private String spec;

    @DecimalMin(value = "0", message = "价格不合法")
    private BigDecimal price;

    private String desc;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Long getSpecId() {
        return specId;
    }

    public void setSpecId(Long specId) {
        this.specId = specId;
    }

    public String getSpec() {
        return spec;
    }

    public void setSpec(String spec) {
        this.spec = spec;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    @Override
    public String toString() {
        return "ItemEntity{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", specId=" + specId +
                ", spec='" + spec + '\'' +
                ", price='" + price + '\'' +
                ", desc='" + desc + '\'' +
                '}';
    }
}
